#pragma once

#include "CoreMinimal.h"

#include "AbilitySystemComponent.h"
#include "AbilitySystemInterface.h"
#include "BoukenAbilitySystemComponent.h"
#include "AttributeSets/BoukenAttributeSet.h"
#include "GameFramework/Pawn.h"
#include "PawnBase.generated.h"

UCLASS()
class BOUKEN_API APawnBase : public APawn, public IAbilitySystemInterface
{
	GENERATED_BODY()

public:
	APawnBase();

	UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Ability System")
	UBoukenAbilitySystemComponent* AbilitySystemComponent;

	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Ability System")
	bool bSelfHoldAttributes = true;

	UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Ability System")
	const UBoukenAttributeSet* Attributes;

	virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;

	UFUNCTION(BlueprintCallable, Category = "Ability System")
	void AcquireAbility(TSubclassOf<UGameplayAbility> Ability, const int32 Level = 1, const int32 InputID = 0);

	virtual void PossessedBy(AController* NewController) override;

	virtual void Tick(float DeltaTime) override;

	virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
};
